<!--  
      Autore: Nichele Dany
      
-->

<%@ page contentType="text/html"%>

<%@ page import="it.dei.unipd.healthservice.resource.*"%>
<%@ page import="java.util.*" %>

<%@ include file="/jsp/header.jsp"%>

<tr>
	<td style="float:left;">
		<%@ include file="/html/left_menu_cliente.html"%>
	</td>

	<!-- Corpo principale -->
	<td width="727" style="float:right;">
		
				<h3>Visione reclami</h3>
		
				<form id="reclami-form" method="post" name="modulo" action="./dettagli_reclamo" >
				<div class="tab">
				<table width="700" class="corpo" >
					<thead><tr><th></td><th><b>Codice</b></th><th><b>Stato</b></th><th><b>Data Apertura</b></th></tr></thead>
					<tbody>
			
			<% 
			
			List<Reclamo> reclami = (List<Reclamo>)request.getAttribute("reclami");
			if (reclami==null)
				{reclami = new ArrayList<Reclamo>();}
			
			for (Reclamo r : reclami) {%>
				<tr><td><input type="radio" id="idreclamo" name="idreclamo" value="<%=r.getCodice()%>" /></td><td><%=r.getCodice()%></td><td><%=r.getStatoGlobale()%></td><td><%=r.getDataApertura()%></td></tr>
						
			<% } %>
			
			
			</tbody>
			</table>
			</div>
			<script>
					function controllo()
					{
					     
                        var checkboxs=document.getElementsByName("idreclamo");
				        var okay=false;
				        for(var i=0,l=checkboxs.length;i<l;i++)
				        {
				         if(checkboxs[i].checked)
				          {
				            okay=true;
				          }
				        }
						if (!okay) {
						alert('Scegliere un reclamo per visualizarne il dettaglio');
						}
						else {
							document.forms["reclami-form"].submit();
				    
							}
					}
					</script>
		         <input type="button" onclick="controllo()" value="Dettagli Reclamo" />
		</form>
		</td>
	
			
	<!-- fine corpo principale -->

</tr>

<tr>
	<td height="20">&nbsp;</td>
</tr>
<tr>
	<td align="center"><img
			src="images/footer.gif" alt="" width="920" height="4" border="0"></td>
</tr>
<tr>
	<%@ include file="/html/footer.html"%>
</tr>
</table>
</body>
</html>
